import { BaseEntity } from '@cool-midway/core';
import { Column, Entity } from 'typeorm';

/**
 * 导航菜单
 */
@Entity('app_menu')
export class MenuEntity extends BaseEntity {
  @Column({ comment: '名称' })
  name: string;

  @Column({ comment: '图标' })
  icon: string;

  @Column({ comment: '路径' })
  path: string;

  @Column({ comment: '标签', nullable: true })
  badge: string;

  @Column({ comment: '登录 0:无需登录 1:需要登录', default: 1, type: 'tinyint' })
  login: number;

  @Column({ comment: '认证 0:无需认证 1:需要认证', default: 1, type: 'tinyint' })
  stuauth: number;

  @Column({ comment: '会员 0:普通 1：会员', default: 0, type: 'tinyint' })
  vip: number;

  @Column({ comment: '小程序ID', nullable: true })
  appId: string;

  @Column({ comment: '排序', default: 0 })
  sort: number;

  @Column({ comment: '类型 nav:页面 mp:小程序', default: 'nav', type: 'enum', enum: ['nav', 'mp'] })
  type: string;

  @Column({ comment: '状态 0:禁用 1：启用', default: 1, type: 'tinyint' })
  status: number;
}
